/* Copyright (c) 2010 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.orkut.client.api.samples.greetings.client.services;

import static com.google.orkut.client.api.samples.greetings.client.services.Objects.eq;
import static com.google.orkut.client.api.samples.greetings.client.services.Objects.hashCodeOf;

import java.io.Serializable;

/**
 * Information about a user.
 *
 * @author Shishir Birmiwal
 */
public class UserInfo implements Serializable {
  public String id;
  public String userName;
  public String thumbnailUrl;

  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }
    if (!(obj instanceof UserInfo)) {
      return false;
    }
    UserInfo that = (UserInfo) obj;
    return eq(id, that.id) && eq(userName, that.userName) && eq(thumbnailUrl, that.thumbnailUrl);
  }

  @Override
  public int hashCode() {
    return hashCodeOf(id, userName, thumbnailUrl);
  }
}